SWEP.Author 		= "Tezzanator"
SWEP.Instructions 	= "Point and shoot"
SWEP.Contact 		= ""
SWEP.Purpose 		= ""
 
SWEP.AdminSpawnable = false
SWEP.Spawnable 		= false
 
SWEP.ViewModelFOV 	= 64
SWEP.ViewModel 		= "models/weapons/v_smg1.mdl"
SWEP.WorldModel 	= "models/weapons/w_smg1.mdl"

SWEP.HoldType = "smg"
SWEP.ReloadSound = "weapons/smg1/smg1_reload.wav"

SWEP.base = "weapon_base" 

SWEP.Primary.Sound = "weapons/smg1/smg1_fire1.wav"
SWEP.Primary.Damage = 7
SWEP.Primary.TakeAmmo = 1
SWEP.Primary.ClipSize = 380
SWEP.Primary.Ammo = "SMG1"
SWEP.Primary.DefaultClip = 380
SWEP.Primary.Spread = 0.4
SWEP.Primary.NumberofShots = 1
SWEP.Primary.Automatic = true
SWEP.Primary.Delay = 0.13
SWEP.Primary.Force = 1000

SWEP.Secondary.ClipSize = -1;
SWEP.Secondary.DefaultClip = -1;
SWEP.Secondary.Automatic = false;
SWEP.Secondary.Ammo = "none";


-- aware of gamemode specifics, such as stats.
-- LEts load them now
function SWEP:Equip( NewOwner )
    self.Primary.Delay = self.Primary.Delay / (NewOwner:GetWeaponSpeed() / 100)
	self.Primary.ClipSize = self.Primary.ClipSize * (NewOwner:GetClipSize() / 100)
	self.Primary.DefaultClip = self.Primary.DefaultClip * (NewOwner:GetClipSize() / 100)
	self.Weapon:SetClip1(self.Primary.ClipSize * (NewOwner:GetClipSize() / 100))
end

function SWEP:PrimaryAttack() 
	if ( !self:CanPrimaryAttack() ) then return end 
 
	local bullet = {} 
		bullet.Num = self.Primary.NumberofShots 
		bullet.Src = self.Owner:GetShootPos() 
		bullet.Dir = self.Owner:GetAimVector() 
		bullet.Spread = Vector( (self.Primary.Spread * (self.Owner:GetSpread() / 100)) * 0.1 , (self.Primary.Spread * (self.Owner:GetSpread() / 100)) * 0.1, 0) 
		bullet.Tracer = 0 
		bullet.Force = self.Primary.Force 
		bullet.Damage = self.Primary.Damage 
		bullet.AmmoType = self.Primary.Ammo 
 
 
	self:ShootEffects() 
 
	self.Owner:FireBullets( bullet ) 
	self:EmitSound(Sound(self.Primary.Sound)) 
	
	self:TakePrimaryAmmo(self.Primary.TakeAmmo) 
 
	self:SetNextPrimaryFire( CurTime() + self.Primary.Delay )
	self:SetNextSecondaryFire( CurTime() + self.Primary.Delay ) 
end 
